scale = 3;
netname = 'FSRCNN_Batch';
% netname = 'FSRCNN';
% ImgSet = 'Set5';
ImgSet = 'Set14';
[psnrs, ssims] = sranaly.analySRQuality(ImgSet, [], scale, netname, [], []);

%%
% y = imread(fullfile(srpath.getDataPath('Set5'), 'baby_GT.bmp'));
y = imread(fullfile(srpath.getDataPath('Urban100'), 'img002.jpg'));
y = rgb2ycbcr(y);  y = y(:, :, 1);

scale = 2;
x = imresize(y, 1/scale, 'Bicubic');

x = single(x);
%%
tic
yhat1 = FSRCNN.deploy(x, scale);
toc

%%
tic
hDeploy = @(x) FSRCNN.deploy(x, scale);
yhat2 = srmodel.deploy(x, hDeploy);
toc

%%
% clc
tic
block_size = 81;   border_size = 5;
blocks = srimg.img2blocks(x, block_size, border_size);
yhat3 = FSRCNN.deploy_batch(blocks, scale);
yhat4 = srimg.blocks2img(yhat3, size(y), border_size*scale);
toc

%%
disp([
srimg.psnr(y, yhat1, scale)
srimg.psnr(y, yhat2, scale)
srimg.psnr(y, yhat4, scale)
])
